﻿<!--#include file="const.inc"-->
<%
'====================================================================
' 感谢使用晴天3G智能建站系统..
' 作者:梁永强.QQ:766750857
' 官方网址:wap.qt3g.com
' 声明:软件版权归作者所有,没有经过作者本人同意不得非法破解和传播本程序
'====================================================================
%>
<!--#include file="abcdh.asp"-->
<%
if sid="Null"  then
%>
<%=title1%><%=we%>
	你还没登陆,请先登陆。<%=we0%><%=sou%>
	<a href="/login.asp?url=<%=Request("urls")%>">马上登陆</a><br/>
<%
else


	IF  Request.QueryString("Action")="del" Then
		call del
	elseIF  Request.QueryString("Action")="alldel" Then
		call alldel
	else
		call index
	end if


end if
	dim urls,url
	url=Request.QueryString("url")
	if url="" then url="index.asp"
	urls=trim(Request("urls"))
	if urls<>"" then url=urls

%>	<a href="mysouzan.asp?sid=<%=sidd%>&amp;url=<%=url%>">我的收藏夹</a><%=we0%><%=qingtian.qingsav("61")%>


<%
End Function




sub index

	dim rs,sql,url
	url=Request.QueryString("url")
	if url="" then url="index.asp"


		dim name,urls
		name=Trim(Request("name"))
		urls=trim(Request("urls"))
		if urls<>"" then
			url=urls
		end if
%>
<!--#include file="abcdh.asp"-->
<%=title2%><%=we%>
<%
qingtian.info


		if name<>"" and urls<>"" then

			set rs=Server.CreateObject("Adodb.Recordset")
			rs.open "select name,nid,urls from qingtian_bookmark ",conn,1,3
			rs.addnew()	
			rs("name")=Name
			rs("nid")=qingtian.nid
			rs("urls")=urls
			rs.update
			Rs.close
			set rs=nothing
		%>
		恭喜,你已成功添加收藏。<%=we0%><%=sou%>
		<a href="<%=qingtian.backurl(urls)%>">返回来源页</a><%=we0%><%=dao%>
		<%
		else
		%>
		添加收藏出错!<%=we0%><%=sou%>
		<a href="<%=qingtian.backurl(urls)%>">返回来源页</a><%=we0%><%=dao%>
		<%
		end if


end sub


sub del
	dim rs,sql,url,id
	url=Request.QueryString("url")
	if url="" then url="index.asp"


		id=Request.QueryString("id")
		if not isnumeric(id) then id=0
		if id="" then id=0
		id=clng(id)

%>
<!--#include file="abcdh.asp"-->
<%=title3%><%=we%>
<%
qingtian.info

			set rs=Server.CreateObject("Adodb.Recordset")
			rs.open "select id from qingtian_bookmark where id="&id&" and [nid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"')" ,conn,1,3
			if not (rs.bof and rs.eof)  then
			rs.delete
			end if
			Rs.close
			set rs=nothing
%>

			删除收藏成功。<%=we0%><%=sou%>
	
<%
end sub

sub alldel

	dim rs,sql,url,i,t
	url=Request.QueryString("url")
	if url="" then url="index.asp"


		T=Trim(Request("T"))
		if T<>"" then
			%>
<!--#include file="abcdh.asp"-->
<%=title4%><%=we%>
			<%
			qingtian.info

			Set Rs = Server.CreateObject("Adodb.Recordset")
			Sql = "select id from qingtian_bookmark where [nid]=(select top 1 id from qingtian_user where sid='"&qingtian.Formatsid(sid)&"')"
			Rs.Open Sql,conn,1,3
			if not (rs.bof and rs.eof)  then
				For i=1 to rs.RecordCount
					If Rs.Eof Then
						exit For
					End If

					rs.delete
					Rs.MoveNext
				Next

			end if
			Rs.close
			set rs=nothing
%>
			清空收藏夹成功。<%=we0%><%=sou%>
		<%else%>
<!--#include file="abcdh.asp"-->
<%=title5%><%=we%>
			<%qingtian.info%>
			确定要清空收藏夹吗？<%=we0%><%=sou%>
			<a href="souzan.asp?Action=alldel&amp;T=true&amp;sid=<%=sidd%>&amp;url=<%=url%>">确定清空</a>|<a href="mysouzan.asp?sid=<%=sidd%>&amp;url=<%=url%>">我按错了</a><br/>
		<%end if%>
		<%


end sub%>
